<?php

namespace App\Home;

use Illuminate\Database\Eloquent\Model;

class Profession extends Model
{
    protected $table = 'profession';

    public function rel_course(){
        //专业和专业分类的关系是（相当于商品和商品类型的关系）：一对多
        return $this -> hasMany('App\Home\Course','profession_id','id') -> where('status','2') -> select('id','course_name','banner_img','profession_id','description','type','free','price','click_num') -> orderBy('sort','desc');
    }

}
